<?php

namespace App\Listeners\User;

use App\Events\User\UserRegisterEvent;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Queue\InteractsWithQueue;

class UserRegisterListener
{
    /**
     * Create the event listener.
     *
     * @return void
     */
    public function __construct()
    {
        //
    }

    /**
     * Handle the event.
     *
     * @param  \App\Events\User\UserRegisterEvent  $event
     * @return void
     */
    public function handle(UserRegisterEvent $event)
    {
        //
        app('log')->info('同步监听UserRegisterEvent事件--');
        app('log')->info(json_encode($event));

        switch ($event->userInfo->type) {
            case 1: // 普通用户

                break;
            case 2: // 管理员

                break;
        }
    }
}
